cc.Class({
    extends: cc.Component,

    properties: {
        dsc: cc.Label,
    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},
    onEnable() {
        this.playAct();
    },
    playAct() {
        this.node.y=0;
        this.is_playing = true;
        this.node.stopAllActions();
        this.node.opacity = 0;
        var self = this;
        this.node.runAction(cc.sequence(
            cc.fadeIn(0.23, 1),
            cc.delayTime(1),
            cc.spawn(
                cc.moveTo(0.5,0,50),
                cc.fadeOut(0.5, 0),
            ),

            cc.callFunc(function () {
                self.node.active = false;
                self.is_playing = false;
            })
        ))

    },
    init(str) {
        if (str) {
            this.dsc.string = str;
        }
        this.node.active = true;
        if (!this.is_playing) {
            console.log("可以播放");
            this.playAct();
        }else {
            console.log("正在播放，不能播放")
        }
    },
    start() {

    },

    // update (dt) {},
});
